package com.csun.cmny.provider.service;

import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.model.domain.DmcControllerCardBind;
import com.csun.cmny.provider.model.dto.card.ControllerCardBindDto;
import com.csun.cmny.provider.model.dto.device.DevicePageQuery;
import com.csun.cmny.provider.model.vo.card.ControllerCardVo;
import com.csun.cmny.provider.model.vo.rfid.DmcRfidReaderVo;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-12-05 16:50
 * @Description:
 */
public interface DmcControllerCardBindService extends IService<DmcControllerCardBind> {

    /**
     * query controller card list with page
     *
     * @param devicePageQuery   the device page query
     *
     * @return  the controller card vo list.
     */
    PageInfo queryListWithPage(DevicePageQuery devicePageQuery);

    /**
     * delete controller card by id
     *
     * @param id    the controller card id
     *
     * @return  the int.
     */
    Integer deleteById(Long id);

    /**
     * bind dmc controller card and rfid reader
     *
     * @param controllerCardBindDto the controller card bind dto
     *
     * @return  the int
     */
    Integer bind(ControllerCardBindDto controllerCardBindDto);

    /**
     * untied dmc controller card and rfid reader
     *
     * @param dmcControllerCardBind the dmc controller card bind
     *
     * @return  the int.
     */
    Integer untied(DmcControllerCardBind dmcControllerCardBind);

    /**
     * check rfid reader bind controller card by rfid reader id
     *
     * @param deviceId  the rfid reader id
     *
     * @return  the int.
     */
    boolean checkRfidReaderBindControllerCardById(Long deviceId);

    /**
     * query not bind rfid reader
     *
     * @param groupId   the group id
     *
     * @return  the dmc rfid reader vo list
     */
    List<DmcRfidReaderVo> queryNotBindRfidReader(Long groupId);

    /**
     * 查询门禁控制Id
     *
     * @param id    the rfid reader id
     *
     * @return  the controller card
     */
    ControllerCardVo queryControllerCardByRfidReaderId(Long id);

    /**
     * query controller card list with page
     *
     * @param devicePageQuery   the device page query
     *
     * @return  the controller card vo list.
     */
    List<ControllerCardVo> queryNewListWithPage(DevicePageQuery devicePageQuery);

    /**
     * query controller card by device no
     *
     * @param deviceNo  the device no
     *
     * @return  the controller card vo
     */
    ControllerCardVo queryControllerCardByDeviceNo(String deviceNo);
}
